package com.zh.seckill.rabbitmq;


import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Service
@Slf4j
public class MQSenderMessage {

    @Resource
    private RabbitTemplate rabbitTemplate;

    public void sendMessage(String Message) {

        log.info("发送消息：" + Message);
        rabbitTemplate.convertAndSend("seckillExchange", "seckill.message", Message);
    }
}
